﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Homework_2
{
    class Circel : Shape, GetArea
    {
        double r, area;
       public Circel(double r)
        {
            this.type = "圆形";
            this.r = r;
            if (r<=0)
            {
                this.islegal = false;
            }
            this.getArea();
        }
        public override double getArea()
        {
            area = Math.PI * r * r;
            return area;
            throw new NotImplementedException();
        }

        public override string showInfo()
        {
            if (this.islegal)
            {
                string info = "\n创建了一个圆形，半径为" + this.r + ",面积为" + this.getArea();
                return info;
            }
            throw new NotImplementedException();
        }
    }

}
